import qs from 'qs';
import url from '@/url.config'

export default ({ service, request, tools}) => ({
    //获取类型
    GetstockBytype() {
        return request({
            url: url.ip3+"/spare/listSpareType",
            method: "get",
        })
    },
    //获取属性
    GetlistSpareProperty(){
        return request({
            url:url.ip3+"/spare/listSpareProperty",
            method:"get",
        })
    },
    //备品入库
    PostsaveSpareParts(data){
        return request({
            url:url.ip3+"/spareParts/saveSpareParts",
            method:"post",
            data:data
        })
    },
    // 备品申领
    PostapplySpareParts(data){
        return request({
            url:url.ip3+"/spareParts/applySpareParts",
            method:"post",
            data:data
        })
    },
     //备机入库
     PostsaveSpareStandby(data){
        return request({
            url:url.ip3+"/spareStandby/saveSpareStandby",
            method:"post",
            data:data
        })
    },
    // 备机申领
    PostapplySpareStandby(data){
        return request({
            url:url.ip3+"/spareStandby/applySpareStandby",
            method:"post",
            data:data
        })
    },

    // 查询不同属性的设备
    GetlistEquipmentClassification(id){
        return request({
            url:url.ip3+`/spare/listEquipmentClassification/${id}`,
            method:"get",
           
        })
    },
    // 备品统计分析
    PostsparePartsStatistical(data){
        return request({
            url:url.ip3+"/spareParts/sparePartsStatistical",
            method:"post",
            data:data
        })
    },
     // 备品编辑维护列表
     PostsparePartsShowEditList(data){
        return request({
            url:url.ip3+"/spareParts/sparePartsShowEditList",
            method:"post",
            data:data
        })
    },
    // 备品删除
     DeletedeleteSparePart(id){
        return request({
            url:url.ip3+`/spareParts/deleteSparePart/${id}`,
            method:"delete",
        })
    },
    // 备品批量删除
    PostdeleteSparePartList (data){
        return request({
            url:url.ip3+"/spareParts/deleteSparePartList",
            method:"post",
            data:data
        })
    },
   
     // 备机统计分析
     PostspareStandbyStatistical (data){
        return request({
            url:url.ip3+"/spareStandby/spareStandbyStatistical",
            method:"post",
            data:data
        })
    },
     // 备机编辑维护列表
     PostspareStandbyShowEditList(data){
        return request({
            url:url.ip3+"/spareStandby/spareStandbyShowEditList",
            method:"post",
            data:data
        })
    },
    // 备机删除
    DeleteSpareStandby(id){
        return request({
            url:url.ip3+`/spareStandby/deleteSpareStandby/${id}`,
            method:"delete",
        })
    },
     // 备机批量删除
     PostdeleteSpareStandbyList (data){
        return request({
            url:url.ip3+"/spareStandby/deleteSpareStandbyList",
            method:"post",
            data:data
        })
    },
    //查询部门
    PostdeptFindByPage (data){
        return request({
            url:url.ip2+"/dept/findByPage",
            method:"post",
            data:data
        })
    },
    //设备属性和类型获取设备型号
    PostfindSpareVersionInfoList (data){
        return request({
            url:url.ip3+"/spare/findSpareVersionInfoList ",
            method:"post",
            data:data
        })
    },
    //获取可申领的物资信息
    PostspareApplySearch(data){
        return request({
            url:url.ip3+"/spare/find/spare/apply",
            method:"post",
            data:data
        })
    },
    //获取excel模板下载链接
    GetdownloadSpareTemplate (){
        return request({
            url:url.ip3+"/spare/downloadSpareTemplate ",
            method:"get",
        })
    },

})